From: Florian Müllner Date: Wed, 4 Sep 2013 11:28:31 +0000 (+0200) Subject: st: Make st_scroll_view_update_fade_effect() public X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~3508 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=6fb044f3512bddf4fca2ddeec1562e153f270a78;p=gnome-shell.git st: Make st_scroll_view_update_fade_effect() public Using fixed fade offsets is not always appropriate, this will allow to set them from code instead. https://bugzilla.gnome.org/show_bug.cgi?id=707409 --- diff --git a/src/st/st-scroll-view.c b/src/st/st-scroll-view.c index f59ae9335..eb35928f2 100644 --- a/src/st/st-scroll-view.c +++ b/src/st/st-scroll-view.c @@ -160,19 +160,19 @@ st_scroll_view_get_property (GObject *object, /** * st_scroll_view_update_fade_effect: - * @self: a #StScrollView + * @scroll: a #StScrollView * @vfade_offset: The length of the veritcal fade effect, in pixels. * @hfade_offset: The length of the horizontal fade effect, in pixels. * * Sets the height of the fade area area in pixels. A value of 0 * disables the effect. */ -static void -st_scroll_view_update_fade_effect (StScrollView *self, +void +st_scroll_view_update_fade_effect (StScrollView *scroll, float vfade_offset, float hfade_offset) { - StScrollViewPrivate *priv = ST_SCROLL_VIEW (self)->priv; + StScrollViewPrivate *priv = ST_SCROLL_VIEW (scroll)->priv; /* A fade amount of more than 0 enables the effect. */ if (vfade_offset > 0. || hfade_offset > 0.) @@ -180,7 +180,7 @@ st_scroll_view_update_fade_effect (StScrollView *self, if (priv->fade_effect == NULL) { priv->fade_effect = g_object_new (ST_TYPE_SCROLL_VIEW_FADE, NULL); - clutter_actor_add_effect_with_name (CLUTTER_ACTOR (self), "fade", + clutter_actor_add_effect_with_name (CLUTTER_ACTOR (scroll), "fade", CLUTTER_EFFECT (priv->fade_effect)); } @@ -194,12 +194,12 @@ st_scroll_view_update_fade_effect (StScrollView *self, else { if (priv->fade_effect != NULL) { - clutter_actor_remove_effect (CLUTTER_ACTOR (self), CLUTTER_EFFECT (priv->fade_effect)); + clutter_actor_remove_effect (CLUTTER_ACTOR (scroll), CLUTTER_EFFECT (priv->fade_effect)); priv->fade_effect = NULL; } } - clutter_actor_queue_redraw (CLUTTER_ACTOR (self)); + clutter_actor_queue_redraw (CLUTTER_ACTOR (scroll)); } static void diff --git a/src/st/st-scroll-view.h b/src/st/st-scroll-view.h index 517e7dc21..02dababd4 100644 --- a/src/st/st-scroll-view.h +++ b/src/st/st-scroll-view.h @@ -87,6 +87,9 @@ gboolean st_scroll_view_get_overlay_scrollbars (StScrollView *scroll); void st_scroll_view_set_policy (StScrollView *scroll, GtkPolicyType hscroll, GtkPolicyType vscroll); +void st_scroll_view_update_fade_effect (StScrollView *scroll, + float vfade_offset, + float hfade_offset); G_END_DECLS